home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3DExtension.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  8.6 KB  |  316 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DExtension.a
  3. ;
  4. ;    Contains:    QuickDraw 3D Plug-in Architecture     Interface File.                                
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QD3DEXTENSION__') = 'UNDEFINED' THEN
  18. __QD3DEXTENSION__ SET 1
  19.  
  20.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  21.     include 'QD3D.a'
  22.     ENDIF
  23.     IF &TYPE('__QD3DERRORS__') = 'UNDEFINED' THEN
  24.     include 'QD3DErrors.a'
  25.     ENDIF
  26.  
  27. ; ******************************************************************************
  28. ; **                                                                             **
  29. ; **                                Constants                                      **
  30. ; **                                                                             **
  31. ; ****************************************************************************
  32.  
  33.     IF TARGET_OS_MAC THEN
  34.  
  35. kQ3XExtensionMacCreatorType        EQU        'Q3XT'
  36. kQ3XExtensionMacFileType        EQU        'shlb'
  37.     ENDIF    ; TARGET_OS_MAC
  38.  
  39. ; ******************************************************************************
  40. ; **                                                                             **
  41. ; **                                Object Method types                              **
  42. ; **                                                                             **
  43. ; ****************************************************************************
  44.  
  45.  
  46. kQ3XMethodTypeObjectClassVersion EQU    'vrsn'
  47. ; typedef unsigned long                 TQ3XObjectClassVersion
  48.  
  49.  
  50. kQ3XMethodTypeObjectClassRegister EQU    'rgst'
  51.  
  52. kQ3XMethodTypeObjectClassReplace EQU    'rgrp'
  53.  
  54. kQ3XMethodTypeObjectClassUnregister EQU    'unrg'
  55.  
  56. kQ3XMethodTypeObjectNew            EQU        'newo'
  57.  
  58. kQ3XMethodTypeObjectDelete        EQU        'dlte'
  59.  
  60. kQ3XMethodTypeObjectDuplicate    EQU        'dupl'
  61. ; ******************************************************************************
  62. ; **                                                                             **
  63. ; **                            Object Hierarchy Registration                      **
  64. ; **                                                                             **
  65. ; ****************************************************************************
  66.  
  67. ; *    Q3XObjectHierarchy_RegisterClass
  68. ; *    
  69. ; *    Register an object class in the QuickDraw 3D hierarchy.
  70. ; *    
  71. ; *    parentType            - an existing type in the hierarchy, or 0 to subclass
  72. ; *                            TQ3Object
  73. ; *    objectType            - the new object class type, used in the binary 
  74. ; *                        metafile.  This is assigned at run time and returned
  75. ; *                          to you.
  76. ; *    objectName            - the new object name, used in the text metafile
  77. ; *    metaHandler            - a TQ3XMetaHandler (may be NULL for some classes) 
  78. ; *                          which returns non-virtual methods
  79. ; *    virtualMetaHandler    - a TQ3XMetaHandler (may be NULL as well) which returns
  80. ; *                            virtual methods a child would inherit
  81. ; *    methodsSize            - the size of the class data needed (see 
  82. ; *                            GetClassPrivate calls below)
  83. ; *    instanceSize        - the size of the object instance data needed (see 
  84. ; *                            GetPrivate calls below)
  85.  
  86. ;
  87. ; extern TQ3XObjectClass Q3XObjectHierarchy_RegisterClass(TQ3ObjectType parentType, TQ3ObjectType *objectType, char *objectName, TQ3XMetaHandler metaHandler, TQ3XMetaHandler virtualMetaHandler, unsigned long methodsSize, unsigned long instanceSize)
  88. ;
  89.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  90.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_RegisterClass
  91.     ENDIF
  92.  
  93. ; *    Q3XObjectHierarchy_UnregisterClass
  94. ; *    
  95. ; *    Returns kQ3Failure if the objectClass still has objects 
  96. ; * around; the class remains registered.
  97.  
  98. ;
  99. ; extern TQ3Status Q3XObjectHierarchy_UnregisterClass(TQ3XObjectClass objectClass)
  100. ;
  101.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  102.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_UnregisterClass
  103.     ENDIF
  104.  
  105. ; *    Q3XObjectHierarchy_GetMethod
  106. ; *    
  107. ; *    For use in TQ3XObjectClassRegisterMethod call
  108.  
  109. ;
  110. ; extern TQ3XFunctionPointer Q3XObjectClass_GetMethod(TQ3XObjectClass objectClass, TQ3XMethodType methodType)
  111. ;
  112.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  113.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetMethod
  114.     ENDIF
  115.  
  116. ; *    Q3XObjectHierarchy_NewObject
  117. ; *    
  118. ; *    To create a new object. Parameters is passed into the 
  119. ; *    TQ3XObjectNewMethod as the "parameters" parameter.
  120.  
  121. ;
  122. ; extern TQ3Object Q3XObjectHierarchy_NewObject(TQ3XObjectClass objectClass, void *parameters)
  123. ;
  124.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  125.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_NewObject
  126.     ENDIF
  127.  
  128. ; *    Q3XObjectClass_GetLeafType
  129. ; *    
  130. ; *    Return the leaf type of a class.
  131.  
  132. ;
  133. ; extern TQ3ObjectType Q3XObjectClass_GetLeafType(TQ3XObjectClass objectClass)
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  136.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetLeafType
  137.     ENDIF
  138.  
  139. ; *    Q3XObjectClass_GetVersion
  140. ; *    This routine obtains the the version of a class, referenced by an
  141. ; *    object class type.  Functions for getting the type are in QD3D.h,
  142. ; *    if you have the class name.
  143.  
  144. ;
  145. ; extern TQ3Status Q3XObjectHierarchy_GetClassVersion(TQ3ObjectType objectClassType, TQ3XObjectClassVersion *version)
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_GetClassVersion
  149.     ENDIF
  150.  
  151. ; *    Q3XObjectClass_GetType 
  152. ; *
  153. ; *    This can be used to get the type, given a reference 
  154. ; *    to a class.  This is most useful in the instance where you register a 
  155. ; *    an element/attribute and need to get the type.  When you register an
  156. ; *    element, QD3D will take the type you pass in and modify it (to avoid
  157. ; *    namespace clashes).  Many object system calls require an object type
  158. ; *    so this API call allows you to get the type from the class referernce
  159. ; *    that you will ordinarily store when you register the class.
  160.  
  161. ;
  162. ; extern TQ3Status Q3XObjectClass_GetType(TQ3XObjectClass objectClass, TQ3ObjectType *theType)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  165.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetType
  166.     ENDIF
  167.  
  168.  
  169. ;
  170. ; extern TQ3XObjectClass Q3XObjectHierarchy_FindClassByType(TQ3ObjectType theType)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION Q3XObjectHierarchy_FindClassByType
  174.     ENDIF
  175.  
  176.  
  177.  
  178. ; *    Q3XObjectClass_GetPrivate
  179. ; *    
  180. ; *    Return a pointer to private instance data, a block of instanceSize bytes, 
  181. ; *    from the Q3XObjectHierarchy_RegisterClass call.
  182. ; *    
  183. ; *    If instanceSize was zero, NULL is always returned.
  184.  
  185. ;
  186. ; extern void *Q3XObjectClass_GetPrivate(TQ3XObjectClass objectClass, TQ3Object targetObject)
  187. ;
  188.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  189.         IMPORT_CFM_FUNCTION Q3XObjectClass_GetPrivate
  190.     ENDIF
  191.  
  192. ; * Return the "TQ3XObjectClass" of an object
  193.  
  194. ;
  195. ; extern TQ3XObjectClass Q3XObject_GetClass(TQ3Object object)
  196. ;
  197.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION Q3XObject_GetClass
  199.     ENDIF
  200.  
  201.  
  202.  
  203. ; ******************************************************************************
  204. ; **                                                                             **
  205. ; **                    Shared Library Registration Entry Point                      **
  206. ; **                                                                             **
  207. ; ****************************************************************************
  208.  
  209. TQ3XSharedLibraryInfo    RECORD 0
  210. registerFunction         ds.l    1                ; offset: $0 (0)
  211. sharedLibrary             ds.l    1                ; offset: $4 (4)
  212. sizeof                     EQU *                    ; size:   $8 (8)
  213.                         ENDR
  214. ;
  215. ; extern TQ3Status Q3XSharedLibrary_Register(TQ3XSharedLibraryInfo *sharedLibraryInfo)
  216. ;
  217.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  218.         IMPORT_CFM_FUNCTION Q3XSharedLibrary_Register
  219.     ENDIF
  220.  
  221. ;
  222. ; extern TQ3Status Q3XSharedLibrary_Unregister(unsigned long sharedLibrary)
  223. ;
  224.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  225.         IMPORT_CFM_FUNCTION Q3XSharedLibrary_Unregister
  226.     ENDIF
  227.  
  228.  
  229. ; ******************************************************************************
  230. ; **                                                                             **
  231. ; **                                Posting Errors                                  **
  232. ; **                                                                             **
  233. ; **            You may only call these functions from within an extension         **
  234. ; **                                                                             **
  235. ; ****************************************************************************
  236.  
  237. ; *    Q3XError_Post
  238. ; *    
  239. ; *    Post a QuickDraw 3D Error from an extension.
  240.  
  241. ;
  242. ; extern void Q3XError_Post(TQ3Error error)
  243. ;
  244.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  245.         IMPORT_CFM_FUNCTION Q3XError_Post
  246.     ENDIF
  247.  
  248. ; *    Q3XWarning_Post
  249. ; *    
  250. ; *    Post a QuickDraw 3D Warning, from an extension.  Note the warning code you
  251. ; *    pass into this routine must already be defined in the table above.
  252.  
  253. ;
  254. ; extern void Q3XWarning_Post(TQ3Warning warning)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION Q3XWarning_Post
  258.     ENDIF
  259.  
  260. ; *    Q3XNotice_Post
  261. ; *    
  262. ; *    Post a QuickDraw 3D Notice, from an extension.  Note the notice code you
  263. ; *    pass into this routine must already be defined in the table above.
  264.  
  265. ;
  266. ; extern void Q3XNotice_Post(TQ3Notice notice)
  267. ;
  268.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  269.         IMPORT_CFM_FUNCTION Q3XNotice_Post
  270.     ENDIF
  271.  
  272.  
  273.     IF TARGET_OS_MAC THEN
  274. ; *    Q3XMacintoshError_Post
  275. ; *    
  276. ; *    Post the QuickDraw 3D Error, kQ3ErrorMacintoshError, and the Macintosh
  277. ; *    OSErr macOSErr. (Retrieved with Q3MacintoshError_Get)
  278.  
  279. ;
  280. ; extern void Q3XMacintoshError_Post(OSErr macOSErr)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION Q3XMacintoshError_Post
  284.     ENDIF
  285.  
  286.     ENDIF    ; TARGET_OS_MAC
  287.  
  288.     ENDIF ; __QD3DEXTENSION__ 
  289.  
  290.